package com.cskaoyan.controller.pz;

import com.cskaoyan.bean.pz.ColumnsAndRowBean;
import com.cskaoyan.bean.pz.GoodsRowsBean;
import com.cskaoyan.bean.pz.OrderRowsBean;
import com.cskaoyan.bean.pz.UserRowsBean;
import com.cskaoyan.service.pz.StatService;
import com.cskaoyan.vo.BaseRespVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("admin/stat")
public class StateController {

    @Autowired
    StatService statService;

    @RequestMapping("/user")
    public BaseRespVo statUser() {
        ColumnsAndRowBean<UserRowsBean> data = statService.queryStatUser();
//        ItemsBean<AddressVO> data = addressService.queryList(page,limit,name,userId,sort,order);
        return BaseRespVo.ok(data);
    }

    @RequestMapping("/order")
    public BaseRespVo statOrder(){

        ColumnsAndRowBean<OrderRowsBean> data = statService.queryStatOrder();
        return BaseRespVo.ok(data);
    }

    @RequestMapping("/goods")
    public BaseRespVo statGoods(){

        ColumnsAndRowBean<GoodsRowsBean> data = statService.queryStatGoods();
        return BaseRespVo.ok(data);
    }
}
